package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserBatchPayOrder;
import com.baseweb.webadmin.core.model.pojo.ByUserBatchPayOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserBatchPayOrderMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    int countByExample(ByUserBatchPayOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    int deleteByExample(ByUserBatchPayOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    @Delete({
        "delete from by_user_batch_pay_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    @Insert({
        "insert into by_user_batch_pay_order (batch_num, user_id, ",
        "order_ids, price, ",
        "create_time, ",
        "update_time, ",
        "status, alipayNotifyTime, ",
        "alipayNotifyType, alipayNotifyId, ",
        "alipayTradeNo, alipayTradeStatus, ",
        "alipaySellerId, alipaySellerEmail, ",
        "alipayTotalFee, alipayGmtCreate, ",
        "alipayGmtPayment, ",
        "descn, price_type)",
        "values (#{batchNum,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, ",
        "#{orderIds,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, ",
        "#{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{status,jdbcType=INTEGER}, #{alipaynotifytime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{alipaynotifytype,jdbcType=VARCHAR}, #{alipaynotifyid,jdbcType=VARCHAR}, ",
        "#{alipaytradeno,jdbcType=VARCHAR}, #{alipaytradestatus,jdbcType=VARCHAR}, ",
        "#{alipaysellerid,jdbcType=VARCHAR}, #{alipayselleremail,jdbcType=VARCHAR}, ",
        "#{alipaytotalfee,jdbcType=DECIMAL}, #{alipaygmtcreate,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{alipaygmtpayment,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{descn,jdbcType=VARCHAR}, #{priceType,jdbcType=INTEGER})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserBatchPayOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    int insertSelective(ByUserBatchPayOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    List<ByUserBatchPayOrder> selectByExample(ByUserBatchPayOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    @Select({
        "select",
        "id, batch_num, user_id, order_ids, price, create_time, update_time, status, ",
        "alipayNotifyTime, alipayNotifyType, alipayNotifyId, alipayTradeNo, alipayTradeStatus, ",
        "alipaySellerId, alipaySellerEmail, alipayTotalFee, alipayGmtCreate, alipayGmtPayment, ",
        "descn, price_type",
        "from by_user_batch_pay_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserBatchPayOrder selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserBatchPayOrder record, @Param("example") ByUserBatchPayOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    int updateByExample(@Param("record") ByUserBatchPayOrder record, @Param("example") ByUserBatchPayOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserBatchPayOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_batch_pay_order
     *
     * @mbggenerated Sun Apr 23 01:04:09 CST 2017
     */
    @Update({
        "update by_user_batch_pay_order",
        "set batch_num = #{batchNum,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "order_ids = #{orderIds,jdbcType=VARCHAR},",
          "price = #{price,jdbcType=DECIMAL},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "status = #{status,jdbcType=INTEGER},",
          "alipayNotifyTime = #{alipaynotifytime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "alipayNotifyType = #{alipaynotifytype,jdbcType=VARCHAR},",
          "alipayNotifyId = #{alipaynotifyid,jdbcType=VARCHAR},",
          "alipayTradeNo = #{alipaytradeno,jdbcType=VARCHAR},",
          "alipayTradeStatus = #{alipaytradestatus,jdbcType=VARCHAR},",
          "alipaySellerId = #{alipaysellerid,jdbcType=VARCHAR},",
          "alipaySellerEmail = #{alipayselleremail,jdbcType=VARCHAR},",
          "alipayTotalFee = #{alipaytotalfee,jdbcType=DECIMAL},",
          "alipayGmtCreate = #{alipaygmtcreate,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "alipayGmtPayment = #{alipaygmtpayment,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "descn = #{descn,jdbcType=VARCHAR},",
          "price_type = #{priceType,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserBatchPayOrder record);
}